#pragma once
#include "stdafx.h"
#include "FbxDocument.h"
#include "FbxPeripheral.h"
#include "FbxDocumentInfo.h"
#include "FbxTakeInfo.h"
#include "FbxError.h"
#include "FbxString.h"
#include "FbxClassId.h"
#include "FbxSdkManager.h"
#include "FbxStringRefArray.h"

namespace Skill
{
	namespace FbxSDK
	{

		FBXOBJECT_DEFINITION(FbxDocument,KFbxDocument);

		void FbxDocument::CollectManagedMemory()
		{
			_DocumentInfo = nullptr;
			_Peripheral = nullptr;
			_KError = nullptr;
			_PathToRootDocument = nullptr;
			FbxCollection::CollectManagedMemory();
		}

		REF_PROPERTY_GET_DEFINATION_FROM_REF(FbxDocument,KFbxDocumentInfo,GetDocumentInfo(),FbxDocumentInfo,DocumentInfo);		
		void FbxDocument::DocumentInfo::set(FbxDocumentInfo^ value)
		{
			_DocumentInfo = value;
			_Ref()->SetDocumentInfo(value->_Ref());
		}			

		void FbxDocument::Peripheral::set(FbxPeripheral^ value)
		{
			_Peripheral = value;
			_Ref()->SetPeripheral(_Peripheral->_Ref());
		}
		REF_PROPERTY_GET_DEFINATION_FROM_REF(FbxDocument,KFbxPeripheral,GetPeripheral(),FbxPeripheral,Peripheral);
		
		int FbxDocument::UnloadContent()
		{
			return _Ref()->UnloadContent();
		}
		int FbxDocument::LoadContent()
		{
			return _Ref()->LoadContent();
		}

		REF_PROPERTY_GET_DEFINATION_FROM_VALUE(FbxDocument,GetPathToRootDocument(),FbxString,PathToRootDocument);		
		bool FbxDocument::CreateTake(String^ name)
		{
			STRINGTOCHAR_ANSI(n,name);			
			bool b = _Ref()->CreateTake(n);
			FREECHARPOINTER(n);
			return b;
		}
		bool FbxDocument::RemoveTake(String^ name)
		{
			STRINGTOCHAR_ANSI(n,name);			
			bool b = _Ref()->RemoveTake(n);
			FREECHARPOINTER(n);
			return b;
		}
		bool FbxDocument::SetCurrentTake(String^ name)
		{
			STRINGTOCHAR_ANSI(n,name);			
			bool b = _Ref()->SetCurrentTake(n);
			FREECHARPOINTER(n);
			return b;
		}
		String^ FbxDocument::GetCurrentTakeName()
		{
			return gcnew String(_Ref()->GetCurrentTakeName());
		}

		void FbxDocument::FillTakeNameArray(FbxStringRefArray^ nameArray)
		{
			_Ref()->FillTakeNameArray(*nameArray->_Ref());		
			nameArray->UpdateInternalList();
		}

		bool FbxDocument::SetTakeInfo(FbxTakeInfo^ takeInfo)
		{
			return _Ref()->SetTakeInfo(*takeInfo->_Ref());
		}
		FbxTakeInfo^ FbxDocument::GetTakeInfo(FbxString^ takeName)
		{
			return gcnew FbxTakeInfo(_Ref()->GetTakeInfo(*takeName->_Ref()));
		}
		REF_PROPERTY_GET_DEFINATION_FROM_VALUE(FbxDocument,GetError(),FbxError,KError);
		
		FbxDocument::Error FbxDocument::LastErrorID::get()
		{
			return (Error)_Ref()->GetLastErrorID();
		}			
		String^ FbxDocument::LastErrorString::get()
		{
			return gcnew String(_Ref()->GetLastErrorString());
		}			
#ifndef DOXYGEN_SHOULD_SKIP_THIS		

		CLONE_DEFINITION(FbxDocument,KFbxDocument);

#endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS

	}
}